package com.vng.poker;

import com.badlogic.gdx.Application.ApplicationType;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.gsn.common.Settings;
import com.gsn.desktop.engine.DownloadDesktop;
import com.gsn.desktop.engine.InputChatDesktop;
import com.gsn.engine.mercurry.MercuryClient;
import com.gsn.engine.utility.UtilityDesktop;
import com.gsn.engine.utility.UtilityGettor;
import com.gsn.poker.game.MyPoker;
import com.gsn.poker.game.PokerGame;

public class Desktop {

	public static void createGame(int mode) {
		switch (mode) {
		case 1:
			createGame(240, 320);
			MyPoker.game.scale = (320f / 480 + 240f / 320) / 2.1f;
			break;
		case 2:
			createGame(320, 480);
			MyPoker.game.scale = 1;
			break;
		case 3:
			createGame(540, 960);
			MyPoker.game.scale = 1.4f;
			break;
		case 4:
			createGame(480, 800);
			MyPoker.game.scale = 1.4f;
			break;
		case 5:
			createGame(600, 1024);
			MyPoker.game.scale = 1.7f;
			break;
		case 6:
			createGame(800, 1280);
			MyPoker.game.scale = 2.0f;

			break;
		}
	}

	public static void binder() {
		MyPoker.game = game;
		MercuryClient client = new MercuryClient(MyPoker.server, 443, game);
		// if (Settings.mode == 1)
		// client.connect();
		Settings.onDT = false;

		MyPoker.client = client;
		MyPoker.chatInput = new InputChatDesktop();

		UtilityGettor._instance = new UtilityDesktop();
		UtilityGettor.initialize();
	}

	static PokerGame game;

	public static void createGame(int width, int height) {
		game = new PokerGame();
		System.out.println("start game");
//		new LwjglApplication(game, "My Caro", height, width, false);
		 new LwjglApplication(game, "My Caro", 801, 481, false);
		// new JoglApplication(game, "My Caro", height, width, true);
		binder();
		System.out.println("Khoi tao xong");
	}

	public static void main(String[] args) {
		createGame(4);
	}
}
